﻿using log4net;
using log4net.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AleaBelli.Core.Util
{
    public class Logger
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(Logger)); 
        
        private static readonly Lazy<Logger> lazy = new Lazy<Logger>(() => new Logger());

        public static Logger Instance { get { return lazy.Value; } }

        private Logger()
        {
            XmlConfigurator.Configure(new System.IO.FileInfo("logging.xml"));
        }

        public void Info(object o)
        {
            log.Info(o);
        }

        public void Debug(object o)
        {
            log.Debug(o);
        }

        public void Warn(object o)
        {
            log.Warn(o);
        }

        public void Error(object o)
        {
            log.Error(o);
        }

        public bool isInfoEnabled
        {
            get
            {
                return log.IsInfoEnabled;
            }
        }

        public bool isDebugEnabled
        {
            get
            {
                return log.IsDebugEnabled;
            }
        }
    }
}
